package com.car.Test;

import com.car.domain.Employee;
import com.car.utils.JDBCUtils;
import org.junit.Test;

import java.util.List;

public class JDBCUtilsTest {
    @Test
    public void test() throws Exception {
        String sql="select * from t_car where id =?";
        JDBCUtils.createPreparedStatement(sql,1);
    }
    @Test
    public void update() throws Exception {
        String sql="insert into t_employee(name,age,gender,work_id,salary)"+ "values(?,?,?,?,?)";
        JDBCUtils.update(sql,"cake",15,"男",9527,4980);
    }
    @Test
    public void query() throws Exception {
       String sql="select * from t_employee";
        Employee query = JDBCUtils.query(sql, Employee.class);
        System.out.println(query);
    }
    @Test
    public void queryList()throws Exception{
        String sql="select * from t_employee";
        List<Employee>employees=JDBCUtils.querylist(sql, Employee.class);
        System.out.println(employees);
    }

}

